import { globby } from "globby";
import fs from "fs-extra";
/** 获取文件夹下的训练文件 */
export const getData = async () => {
    const tag = await fs.readdir("./src/data/");
    return await Promise.all(
        tag.map(async (folder) => {
            const list = await globby("./src/data/" + folder + "/*");
            const files = await Promise.all(
                list.map((i) => {
                    return fs.readFile(i, "utf-8");
                })
            );
            return {
                type: folder,
                files,
            };
        })
    );
};
